package com.qd.common.sys.domain.entity.upload;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 文件上传通用类
 *
 * @author sjk
 */
@Data
@Accessors(chain = true)
public class FileUploadDTO {

    @NotBlank(message = "附件ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "附件ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String id;
    private Integer idx;
    @NotBlank(message = "附件类型不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "附件类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String attachmentType;

    public void freeData() {
        this.id = null;
        this.idx = null;
        this.attachmentType = null;
    }
}
